<template>
  <section class="index">
    <div class="hello">
      <i class="iconfont icon-xihuan"></i><span> 欢迎登录，{{user.userName}}老师。</span>
    </div>
    <div class="msg">
      
    </div>
  </section>
</template>

<script>
export default {
  data() {
    return {
      user: {
        userName: null,
        userId: null
      } 
    }
  },
  created() {
    this.getUserInfo()
  },
  methods: {
     
    getUserInfo() {
     let role = this.$cookies.get("role")
     if(role == 1 ){
       let userName = this.$cookies.get("teacherName")
      let userId = this.$cookies.get("teacherId")
      this.user.userName = userName
      this.user.userId = userId
     }else{
       let userName = this.$cookies.get("adminName")
      let userId = this.$cookies.get("adminId")
      this.user.userName = userName
      this.user.userId = userId
     }
     
    },
    openMsg() {
      this.$alert('',{
        confirmButtonText: '确定'
      })
    }
  }
}
</script>


<style lang="scss" scoped>
.index {
  margin-left: 70px;
  .hello {
    font-size: 20px;
    color: #726f70;
    .icon-xihuan {
      font-size: 30px;
      color: #dd6572;
    }
  }
  .msg {
    .title {
      font-size: 16px;
      color: #000;
      margin-top: 20px;
      margin-left: 10px;
    }
    ul {
      display: flex;
      flex-direction: column;
      width: 200px;
      overflow: hidden;
    }
    li {
      margin-top: 10px;
      font-size: 14px;
      color: lightcoral;
      cursor: pointer;
      display: inline-block;
    }
  }
}
</style>

